<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
        function loadRightDiv(divId,url){
            console.log(url);
            var val=$('input:radio[name="expNameId"]:checked').val();
            if(val!=null){
                $("#"+divId).load(url);
            }else{
                toastr.error("请先选择左侧消耗品名称数据");
            }
        }
</script>
<div class="app">
    <section class="layout">
        <section class="main-content col-lg-3">
            <div class="content-wrap" id="nameLeftDiv">
                <div class="wrapper" style="bottom: 50px;">
                    <section class="panel panel-default">
                        <div class="panel-body">
                            <div class="table-responsive no-border">
                                <div class="datatable-top">
                                    <div class="pull-left">
                                        <form:form id="searchForm" modelAttribute="expNameDict"  onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/csm/expPrice/modify');" method="post" class="form-inline">
                                            <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                            <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                            <label>消耗品代码 ：</label><form:input path="expCode" htmlEscape="false" maxlength="50" class="form-control" />
                                            &nbsp;&nbsp;<br/><label>消耗品名称 ：</label><form:input path="expName" htmlEscape="false" maxlength="50" class="form-control" />
                                            <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>

                                        </form:form>
                                    </div>
                                </div>
                                <table id="contentTable" class="table table-bordered mg-t datatable">
                                    <thead>
                                    <tr>
                                        <th>消耗品代码</th>
                                        <th>消耗品名称</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${namepage.list}" var="expNameDict">
                                    <tr onclick="loadDiv('priceRightDiv','${ctx}/csm/expPrice/indexModify?expInfo.expDict.expCode=${expNameDict.expCode}')">
                                        <td> ${expNameDict.expCode}</td>
                                        <td> ${expNameDict.expName}</td>
                                    </tr>
                                    </c:forEach>

                                </table>
                                <div class="pagination">${namepage}</div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </section>
        <section class="main-content col-lg-9">
            <div class="content-wrap" id="priceRightDiv">
                <div class="wrapper" style="bottom: 50px;">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a href="#"   onclick="loadDiv('priceRightDiv','${ctx}/csm/expPrice/indexModify')">消耗品价格列表</a>
                        </li>
                        <%--<li>--%>
                            <%--<a href="#" onclick="loadRightDiv('priceRightDiv','${ctx}/csm/expPrice/formModify?expInfo.expDict.expCode=${expPrice.expInfo.expDict.expCode}')">消耗品价格添加</a>--%>
                        <%--</li>--%>
                    </ul>
                    <section class="panel panel-default">
                        <div class="panel-body">
                            <div class="table-responsive no-border">
                                <div class="datatable-top">
                                    <div class="pull-left">
                                        <form:form id="searchPriceForm" modelAttribute="expPrice"  onsubmit="return loadDivForm('priceRightDiv','searchPriceForm','${ctx}/csm/expPrice/indexModify');" method="post" class="form-inline">
                                            <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                            <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                        </form:form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </section>
    </section>
</div>
